import { App } from "vue";
import dayjs from "dayjs";
import utc from "dayjs/plugin/utc";
dayjs.extend(utc);
const DEFAULT_FORMAT_STRING = "YYYY-MM-DD";
export default function (app: App) {
  app.config.globalProperties.formatTime = function (
    utcStr: string,
    formatSrt: string = DEFAULT_FORMAT_STRING
  ) {
    return dayjs.utc(utcStr).utcOffset(8).format(formatSrt);
  };
}
